<?php

require_once('lib/PHPMailer/class.phpmailer.php');

$mail             = new PHPMailer(); // defaults to using php "mail()"
$mail->IsMail();
$mail->WordWrap = 50;                              // set word wrap
$mail->IsHTML(true);                               // send as HTML

$mail->Subject    = "Contato - CONNAD";            // assunto

$mensagem = preg_replace("/(\\r)?\\n/i", "<br/>", $_REQUEST["mensagem"]);

$body = "<b>Nome:</b> ".    $_REQUEST["nome"]    ."<br />"
	  . "<b>E-mail:</b> ".  $_REQUEST["email"]   ."<br />"
	  . "<b>Assunto:</b> ". $_REQUEST["assunto"] ."<br />"
	  . "<b>Mensagem:</b> ".utf8_decode($mensagem)."<br />";

$body = eregi_replace("[\]",'',$body);

$mail->AddReplyTo("contato@connadbelem.com","Form. de Contato");
$mail->From = $_REQUEST["email"];
$mail->FromName = $_REQUEST["nome"];
$mail->AddReplyTo("contato@connadbelem.com ","Form. de Contato");
$address = "contato@connadbelem.com ";
$mail->AddAddress($address, "Contato");

$mail->Body = $body;
$mail->AltBody  =  "This is the text-only body";

//$mail->AddAttachment("images/phpmailer.gif");      // attachment
//$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment

if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "E-mail enviado com sucesso!";
}

?>

